function sameword(arr) {
    let map = new Map();
    arr.forEach(item => {
        let key = item.split('').sort((a, b) => a - b);
        let temp = map.get(key) || []
        map.set(key, temp.push(item))
    })
    return [...map.values()]

}